const libs = {
  version: "1.0.0",
  mixin(lib) {
    let key = lib.key;
    libs[key] = lib;
  },
};

const common = {
  key: "common",
  name: "通用js提示",

  libs: {
    es5: {
      d: ["/code/libs/es5/lib.es5.d.ts"],
    },
    es2015: {
      d: [
        "/code/libs/es2015/lib.es2015.collection.d.ts",
        "/code/libs/es2015/lib.es2015.core.d.ts",
      ],
    },
  },
};

libs.mixin(common);

//nodejs
const node = {
  key: "node",
  name: "nodejs",

  libs: {
    buffer: {
      d: ["/code/libs/node/lib.buffer.d.ts"],
    },
    crypto: {
      d: ["/code/libs/node/lib.crypto.d.ts"],
    },
  },
};

libs.mixin(node);

//lodash
const lodash = {
  key: "lodash",
  name: "lodash",

  libs: {
    lodash: {
      d: [
        "/code/libs/lodash/lib.lodash.d.ts",
        "/code/libs/lodash/common/array.d.ts",
        "/code/libs/lodash/common/collection.d.ts",
        "/code/libs/lodash/common/common.d.ts",
        "/code/libs/lodash/common/date.d.ts",
        "/code/libs/lodash/common/function.d.ts",
        "/code/libs/lodash/common/lang.d.ts",
        "/code/libs/lodash/common/math.d.ts",
        "/code/libs/lodash/common/number.d.ts",
        "/code/libs/lodash/common/object.d.ts",
        "/code/libs/lodash/common/seq.d.ts",
        "/code/libs/lodash/common/string.d.ts",
        "/code/libs/lodash/common/util.d.ts",
      ],
    },
  },
};

libs.mixin(lodash);

//流程接口
const flow = {
  key: "flow",
  name: "流程编程",

  libs: {
    flow_procedure: {
      d: ["/code/libs/flow/lib.flow.procedure.d.ts"],
    },
    data: {
      d: ["/code/libs/data/lib.data.d.ts"],
    },
    program: {
      d: ["/code/libs/program/lib.program.d.ts"],
    },
  },
};

libs.mixin(flow);

const display = {
  key: "display",
  name: "自定义组件功能",

  libs: {
    display_action: {
      d: ["/code/libs/display/lib.display.action.d.ts"],
    },
  },
};

libs.mixin(display);

const view = {
  key: "view",
  name: "自定义组件功能",

  libs: {
    view_action: {
      d: ["/code/libs/view/lib.view.action.d.ts"],
    },
  },
};

libs.mixin(view);

const api = {
  key: "api",
  name: "api编程通用功能",

  libs: {
    curl: {
      d: ["/code/libs/api/lib.curl.d.ts"],
    },
    helper: {
      d: ["/code/libs/api/lib.helper.d.ts"],
    },
    data: {
      d: ["/code/libs/data/lib.data.d.ts"],
    },
    program: {
      d: ["/code/libs/program/lib.program.d.ts"],
    },
  },
};

libs.mixin(api);

const wxwork = {
  key: "wxwork",
  name: "企业微信",

  libs: {
    wxwork: {
      d: ["/code/libs/wxwork/lib.wxwork.d.ts"],
    },
  },
};

libs.mixin(wxwork);

const wxwork_third = {
  key: "wxwork_third",
  name: "企业微信(第三方)",

  libs: {
    wxwork: {
      d: ["/code/libs/wxwork/lib.wxwork_third.d.ts"],
    },
  },
};

libs.mixin(wxwork_third);

const dingtalk = {
  key: "dingtalk",
  name: "钉钉",

  libs: {
    dingtalk: {
      d: ["/code/libs/dingtalk/lib.dingtalk.d.ts"],
    },
  },
};

libs.mixin(dingtalk);

const weixinmp = {
  key: "weixinmp",
  name: "微信公众号",

  libs: {
    weixinmp: {
      d: ["/code/libs/weixinmp/lib.weixinmp.d.ts"],
    },
  },
};

libs.mixin(weixinmp);

const egg = {
  key: "egg",
  name: "egg",

  libs: {
    egg: {
      d: [
        "/code/libs/egg/lib.request.d.ts",
        "/code/libs/egg/lib.response.d.ts",
      ],
    },
  },
};

libs.mixin(egg);

const sequelize = {
  key: "sequelize",
  name: "sequelize",

  libs: {
    sequelize: {
      d: ["/code/libs/sequelize/lib.sequelize.d.ts"],
    },
  },
};

libs.mixin(sequelize);

export default libs;
